import request from '@/utils/request'

// 查询分组列表
export function queryGroupsList(params) {
  return request({
    url: '/admin/wecom/category/list',
    method: 'get',
    params
  })
}

// 新增分组列表
export function addGroup(data) {
  return request({
    url: '/admin/wecom/category/personal/add',
    method: 'post',
    data
  })
}

// 新增企业分组列表
export function addGroupCorp(data) {
  return request({
    url: '/admin/wecom/category/corp/add',
    method: 'post',
    data
  })
}

// 编辑分组
export function editGroup(data) {
  return request({
    url: '/admin/wecom/category/personal/edit',
    method: 'put',
    data
  })
}

// 编辑企业分组
export function editGroupCorp(data) {
  return request({
    url: '/admin/wecom/category/corp/edit',
    method: 'put',
    data
  })
}

// 删除分组
export function deleteGroup(params) {
  return request({
    url: `/admin/wecom/category/personal/${params}`,
    method: 'delete'
    // params:{id:params}
  })
}

// 删除分组
export function deleteGroupCprp(params) {
  return request({
    url: `/admin/wecom/category/corp/${params}`,
    method: 'delete'
    // params:{id:params}
  })
}

// 文件库删除企业分组
export function deleteGroupNew(params) {
  return request({
    url: `/admin/admin/detail/corp/${params}`,
    method: 'delete'
    // params:{id:params}
  })
}

//文件库删除个人分组
export function deleteGroupCprpNew(params) {
  return request({
    url: `/admin/admin/detail/personal/${params}`,
    method: 'delete'
    // params:{id:params}
  })
}

// 创建人下拉查询
export function queryCreated(params) {
  return request({
    url: '/admin/admin/detail/userQuery',
    method: 'get',
    params
  })
}

// 管理机构下拉查询

export function queryDepartment(params) {
  return request({
    url: '/admin/admin/detail/departmentQuery',
    method: 'get',
    params
  })
}

// 文件列表查询
export function queryFileList(data) {
  return request({
    url: '/admin/admin/detail/fileListQuery',
    method: 'post',
    data,
    params:{
      pageNum:data.pageNum,
      pageSize:data.pageSize,
    }
  })
}

// 上传文件
export function uploadFile(data) {
  return request({
    url: '/admin/common/uploadFile',
    method: 'post',
    data
  })
}

// 上传图片
export function uploadImgFile(data) {
  return request({
    url: '/admin/common/uploadPicture',
    method: 'post',
    data
  })
}

// 新增文件
export function createFile(data) {
  return request({
    url: '/admin/admin/detail/fileCreateOrUpdate',
    method: 'post',
    data
  })
}

// 新增文件
export function createFileCorp(data) {
  return request({
    url: '/admin/admin/detail/corp/fileCreateOrUpdate',
    method: 'post',
    data
  })
}

// 删除文件
export function deleteFile(params) {
  return request({
    url: 'admin/admin/detail/deleteFile',
    method: 'get',
    params
  })
}

// 删除文件
export function deleteFileCorp(params) {
  return request({
    url: 'admin/admin/detail/corp/deleteFile',
    method: 'get',
    params
  })
}

//文件详情接口
export function getFileDetails(params) {
  return request({
    url: 'admin/admin/detail/info',
    method: 'get',
    params
  })
}
